  
<div class="panel panel-default">
  <!-- Default panel contents -->
  <div class="panel-heading">Order List</div>
  <?php $status=getFormValue('status');?>
    
  <div class="panel-body">
		<p>
		
		</p>
                <ul class="nav nav-tabs" role="tablist">
		  <li <?php if(!isset($status)){ echo 'class="active"';}?>><a href="dispatch.php?target=order-list">New</a></li>
                  <li <?php if(isset($status)&& $status == 1){ echo 'class="active"';}?>> <a href="dispatch.php?target=order-list&status=1">Shipped</a></li>
                   <li <?php if(isset($status)&& $status == 2){ echo 'class="active"';}?>><a href="dispatch.php?target=order-list&status=2">Delivered</a></li>
                   <li <?php if(isset($status)&& $status == 3){ echo 'class="active"';}?>><a href="dispatch.php?target=order-list&status=3">Canceled</a></li>
                 </ul>
	  <div class="table-responsive">
				<table class="table table-striped">
				  <thead>
					<tr>
					  <th>Order Number</th>
					  <th>Customer</th>
					  <th>total</th>
					  <th>create date</th>
					  <th>last modified date</th>
					  <th>Action</th>
					</tr>
				  </thead>
				  <tbody>
					<?php 
                                                $repository=BO::getOrderBORepository();
						if(!isset($status))
                                                {
                                                    $orderBOs = $repository->getOrderBOs(0); 
                                                }
                                                else
                                                {
                                                  $orderBOs = $repository->getOrderBOs($status); 
                                                }						
						foreach($orderBOs as $orderBO)
						{
					?>
					<tr>
					  <td><?php echo $orderBO->getNumber();?></td>
					  <td><?php echo $orderBO->getCustomerBO()->getName();?></td>
					  <td><?php echo $orderBO->total;?></td>
					  <td><?php echo $orderBO->order_date;?></td>
					  <td><?php echo $orderBO->lastmodified;?></td>
					  <td>
						<div class="btn-group">
                                                    <a href="dispatch.php?target=order-edit&id=<?php echo $orderBO->id ?>"  class="btn btn-default"><span class="glyphicon glyphicon-pencil"></span></a>
						  <div class="btn-group">
							<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
							  Change Status 
							  <span class="caret"></span>
							</button>
							<ul class="dropdown-menu" role="menu">							 
							  <li><a href="dispatch.php?target=order-status&id=<?php echo $orderBO->id ?>&status=1">Ship</a></li>
                                                           <li><a href="dispatch.php?target=order-status&id=<?php echo $orderBO->id ?>&status=2">Deliver</a></li>
                                                           <li><a href="dispatch.php?target=order-status&id=<?php echo $orderBO->id ?>&status=3">Cancel</a></li>
							</ul>
						  </div>
						</div>
					  </td>	
					</tr>
					<?php	
						}
					?>
				  </tbody>
				</table>
		</div>	
	</div>
	 <div class="panel-footer">
		<div>
			  <ul class="pagination pagination">
				<li><a href="#"> << </a></li>
				<li class="active"><a href="#">1</a></li>
				<li><a href="#">2</a></li>
				<li><a href="#">3</a></li>
				<li><a href="#">4</a></li>
				<li><a href="#">5</a></li>
				<li><a href="#"> >> </a></li>
			  </ul>
		 </div>
	 </div>	
</div>	
		  
		  
		  